package com.static_;

/**
 * @Author 小闽
 * @Date 2024/9/4 22:37
 * @PackageName: com.static_
 * @ClassName: VisitStatic
 * @Description: 类变量
 * @Version 1.0
 */
public class VisitStatic {
    public static void main(String[] args) {
        // 类变量随着类的加载而创建。
        System.out.println(A.num);
        A a = new A();
        System.out.println(a.num);
    }
}

class A{
    public static int num = 1;
}
